package com.leyou.item.controller;

import com.leyou.item.pojo.Attention;
import com.leyou.item.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CollectController {

    @Autowired
    private CollectService collectService;

    /**
     * 添加到我的关注
     * @param collect
     * @return
     */
    @PostMapping("collect")
    public ResponseEntity<Void> addCollect(@RequestBody Attention collect){
        this.collectService.addCollect(collect);
        return ResponseEntity.ok().build();
    }
}
